package cn.ultrarisk.scadmin.manager.biz.user.dao;

import cn.ultrarisk.mybatis.extension.query.Query;
import cn.ultrarisk.scadmin.manager.biz.user.entity.Admin;
import cn.ultrarisk.scadmin.manager.support.BaseDAO;
import cn.ultrarisk.scadmin.manager.util.StringUtil;
import org.springframework.stereotype.Repository;

/**
 * 用户数据操作类
 *
 * @author sevendlong(lin23871@163.com)
 * @date 2014/3/28
 * @since V1.0
 */
@Repository
public class AdminDAO extends BaseDAO<Admin, Integer> {
    /**
     * 构造器
     */
    public AdminDAO() {
        super(Admin.class, Admin.COLUMN_PROPERTY_MAP);
    }

    public Admin getByAccount(String account) {
        return StringUtil.isEmpty(account) ? null : get(Query.query(Admin.ACCOUNT, account));
    }
}
